package com.sbr.seb.wicket.element;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.apache.wicket.Page;
import org.apache.wicket.PageParameters;

public class MenuItem implements Serializable {
	
	private static final long serialVersionUID = 1L;
	private Class<? extends Page> page;
	private String pageName;
	private List<MenuItem> sousMenuItemList;
	
	private PageParameters parameters;
	
	public MenuItem(String pageName) {
		this.pageName = pageName;
		this.page = null; //TODO faire qqc pour ça ?
		sousMenuItemList = new ArrayList<MenuItem>();
	}
	
	public MenuItem(String pageName, Class<? extends Page> page) {
		this.pageName = pageName;
		this.page = page;
		sousMenuItemList = new ArrayList<MenuItem>();
	}
	
	public MenuItem(String pageName, Class<? extends Page> page, List<MenuItem> sousMenuItemList) {
		this.pageName = pageName;
		this.page = page;
		this.sousMenuItemList = sousMenuItemList;
	}
	
	public MenuItem(String pageName, Class<? extends Page> page, PageParameters parameters) {
		this.pageName = pageName;
		this.page = page;
		this.parameters = parameters;
		this.sousMenuItemList = new ArrayList<MenuItem>();
		
	}
	
	public String getPageName() {
		return this.pageName;
	}
	
	public Class<? extends Page> getPage() {
		return this.page;
	}

	public List<MenuItem> getSousMenuItemList() {
		return sousMenuItemList;
	}

	public void addSousMenuItem(MenuItem item) {
		sousMenuItemList.add(item);
	}

	public PageParameters getParameters() {
		return parameters;
	}
	
	
}
